import request from '@/utils/request'



// 查询论坛-动态列表
export function listDynamic(query) {
  return request({
    url: '/forum/dynamic/list',
    method: 'get',
    params: query
  })
}

// 查询论坛-动态详细
export function getDynamic(id) {
  return request({
    url: '/forum/dynamic/' + id,
    method: 'get'
  })
}

// 查询论坛-动态列表
export function listGxDynamic(query) {
  return request({
    url: '/forum/dynamic/gx/list',
    method: 'get',
    params: query
  })
}

// 查询论坛-动态详细
export function getGxDynamic(id) {
  return request({
    url: '/forum/dynamic/gx/' + id,
    method: 'get'
  })
}
// 新增论坛-动态
export function addGxDynamic(data) {
  return request({
    url: '/forum/dynamic/gx',
    method: 'post',
    data: data
  })
}

// 新增论坛-动态
export function addDynamic(data) {
  return request({
    url: '/forum/dynamic',
    method: 'post',
    data: data
  })
}

// 修改论坛-动态
export function updateDynamic(data) {
  return request({
    url: '/forum/dynamic',
    method: 'put',
    data: data
  })
}

// 审核论坛-动态
export function auditDynamic(data) {
  return request({
    url: '/forum/dynamic/audit',
    method: 'put',
    data: data
  })
}

// 删除论坛-动态
export function delDynamic(id) {
  return request({
    url: '/forum/dynamic/' + id,
    method: 'delete'
  })
}

// 导出论坛-动态
export function exportDynamic(query) {
  return request({
    url: '/forum/dynamic/export',
    method: 'get',
    params: query
  })
}

// 批量发布
export function release(id) {
  return request({
    url: '/forum/dynamic/release/'+ id,
    method: 'put'
  })
}

// 批量下架
export function offShelf(id) {
  return request({
    url: '/forum/dynamic/offShelf/'+ id,
    method: 'put'
  })
}

// 推荐
export function recommend(id) {
  return request({
    url: '/forum/dynamic/recommend/'+ id,
    method: 'put'
  })
}

// 审核论坛-动态
export function auditGxDynamic(data) {
  return request({
    url: '/forum/dynamic/gx/audit',
    method: 'put',
    data: data
  })
}

// 批量发布
export function releaseGx(id,reason) {
  return request({
    url: '/forum/dynamic/gx/release?reason='+ reason+"&&ids="+id,
    method: 'put'
  })
}

// 批量下架
export function offShelfGx(id) {
  return request({
    url: '/forum/dynamic/gx/offShelf/'+ id,
    method: 'put'
  })
}

